import { create } from 'zustand'
import { createSelectors } from '@/library/libs/zustand/createSelectors'

interface IZCount {
  bears: number;
  increment: () => void;
  decrement: () => void;
}

const useCounterStoreBase = create<IZCount>()((set) => ({
  bears: 0,
  increment: () => set((state) => ({ bears: state.bears + 1 })),
  decrement: () => set((state) => ({ bears: state.bears - 1 })),
}))

export const useCounterStore = createSelectors(useCounterStoreBase)
